import org.w3c.dom.Node;

import java.util.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * Date: 2025-03-19
 * Time: 14:27
 */
public class Test {

    //旧键盘
    public static void main10(String[] args){
        Scanner in = new Scanner(System.in);
        while (in.hasNextLine()){
            String str1 = in.nextLine();
            String str2 = in.nextLine();
            func(str1,str2);
        }
    }
    private static void func(String str1,String str2){
        Set<Character> set = new HashSet<>();

        for (char ch : str2.toUpperCase().toCharArray()) {
            set.add(ch);
        }

        Set<Character> setBroken = new HashSet<>();
        for (char ch : str1.toUpperCase().toCharArray()) {
            if (!set.contains(ch) && !setBroken.contains(ch)){
                System.out.print(ch);
                setBroken.add(ch);
            }
        }


    }


    //宝石与石头
    public int newJewelsInStones(String jewels,String stones){
        Set<Character> set = new HashSet<>();
        for (int i = 0; i < jewels.length(); i++) {
            char ch = jewels.charAt(i);
            set.add(ch);
        }

        int count = 0;
        for (int i = 0; i < stones.length(); i++) {
            char ch = stones.charAt(i);
            if (set.contains(ch)){
                count++;
            }
        }
        return count;
    }


    //随机链表的复制
//    public Node copyRandomList(Node head){
//        Map<Node,Node> map = new HashMap<>();
//        //第一遍遍历链表
//        Node cur = head;
//        while (cur != null){
//            Node node = new Node(cur.val);
//            map.put(cur,node);
//            cur = cur.next;
//        }
//        //第二遍遍历链表
//        cur = head;
//        while (cur != null){
//            map.get(cur).next = map.get(cur.next);
//            map.get(cur).random = map.get(cur,random);
//            cur = cur.next;
//        }
//        return map.get(head);
//    }

    //只出现一次的数字
    public int singleNumber(int[] nums){
        Set<Integer> set = new HashSet<>();

        for (int i = 0; i < nums.length; i++) {
            if (!set.contains(nums[i])){
                set.add(nums[i]);
            }else {
                set.remove(nums[i]);
            }
        }
        for (int i = 0; i < nums.length; i++) {
            if (set.contains(nums[i])){
                return nums[i];
            }
        }
        return -1;
    }
    public static void main(String[] args) {
        HashBucket hashBucket = new HashBucket();
        hashBucket.put(2,99);
        hashBucket.put(3,99);
        hashBucket.put(1,99);
        hashBucket.put(4,99);
        hashBucket.put(14,99);
        hashBucket.put(24,99);
        hashBucket.put(7,99);
        hashBucket.put(8,99);
    }
    public static void main3(String[] args) {
        TreeSet<String> set = new TreeSet<>();
        set.add("abc");
        set.add("def");
        set.add("hello");
        System.out.println(set);
        Iterator<String> it = set.iterator();
        while (it.hasNext()){
            System.out.println(it.next()+" ");
        }
    }
    public static void main2(String[] args) {
        TreeMap<String,Integer> map = new TreeMap<>();
        map.put("def",4);
        map.put("abc",6);

        //根据key获取val值
        Integer integer = map.get("abc");
        System.out.println(integer);

        integer = map.getOrDefault("abcd",99);
        System.out.println(integer);

        Integer rev = map.remove("aba");
        System.out.println(rev);

        Set<String> set = map.keySet();
        System.out.println(set);

        Collection<Integer> collection = map.values();
        System.out.println(collection);

        Set<Map.Entry<String,Integer>> entrySet = map.entrySet();
        for (Map.Entry<String,Integer> entry: entrySet){

        }
    }

    public static void main1(String[] args) {
        int[] array = {10,5,12,13,6};

        BinarySearchTree binarySearchTree = new BinarySearchTree();
        for (int x: array) {
            binarySearchTree.insert(x);
        }
        System.out.println("sfsfsafasf");
    }
}
